; EXPECT: unsat
(set-option :incremental false)
(set-logic ALL)
(set-option :sets-ext true)

(declare-fun x () (Relation Int Int))
(declare-fun y () (Relation Int Int))
(declare-fun r () (Relation Int Int))
(declare-fun t () (Relation Int))
(declare-fun z () (Tuple Int Int))
(assert (= z (tuple 1 2)))
(declare-fun zt () (Tuple Int Int))
(assert (= zt (tuple 2 1)))
(declare-fun v () (Tuple Int Int))
(assert (= v (tuple 1 1)))
(declare-fun a () (Tuple Int Int))
(assert (= a (tuple 1 5)))
(assert (set.member (tuple 1 7) x))
(assert (set.member z x))
(assert (set.member (tuple 7 5) y))
(assert (= t (rel.join_image x 2)))
(assert (set.member (tuple 3) (rel.join_image x 2)))
(assert (not (set.member (tuple 1) (rel.join_image x 2))))
(assert (set.member (tuple 4) (rel.join_image x 2)))
(assert (set.member (tuple 1) (rel.join_image x 1)))
(check-sat)
